﻿using System;
using CoreVirtuoso.Descriptions;

namespace VirtuosoDal.Entities
{
   public class EventPropertyDescription : EntityDescription, IEquatable<EventPropertyDescription>
   {
      public bool IsMultiValued { get; set; }
      public bool IsHierarchy { get; set; }
      public string HierarchyRootUri { get; set; }
      public bool IsNotAutomatic { get; set; }
      public bool IsMultiline { get; set; }

      public EventPropertyDescription(string uri, string label, bool isMultiValued,
                                      bool isHierarchy, string hierarchyRootUri, bool isNotAutomatic, bool isMultiline)
         : base(uri, label)
      {
         this.IsMultiValued = isMultiValued;
         this.IsHierarchy = isHierarchy;
         this.HierarchyRootUri = hierarchyRootUri;
         this.IsNotAutomatic = isNotAutomatic;
         this.IsMultiline = isMultiline;
      }

      #region IEquatable<EventPropertyDescription> Members

      public bool Equals(EventPropertyDescription other)
      {
         if (this.Uri.OriginalString == other.Uri.OriginalString)
            return true;

         return false;
      }

      #endregion

      public override int GetHashCode()
      {
         return this.Uri.OriginalString.GetHashCode();
      }
   }
}